package com.qunchuang.controller;

import com.qunchuang.pojo.dto.AgvLiftStorageLocationDto;
import com.qunchuang.pojo.dto.AgvRequestLiftDto;
import com.qunchuang.pojo.vo.AssignmentLiftStorageLocationVo;
import com.qunchuang.pojo.vo.ResponseVo;
import com.qunchuang.service.LiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/lift")
public class LiftController {
    @Autowired
    private LiftService liftService;

    //请求电梯
    @PostMapping("/request")
    public AssignmentLiftStorageLocationVo requestLift(@RequestBody AgvRequestLiftDto agvRequestLiftDto){
        AssignmentLiftStorageLocationVo assignmented = liftService.assignmentLiftStorageLocation(agvRequestLiftDto);
        return assignmented;
    }

    //呼叫电梯，通知agv进入储位
//    @PostMapping("/enter")
//    public ResponseVo callLift(@RequestBody AgvLiftStorageLocationDto dto){
//        ResponseVo responseVo = liftService.callLift(dto);
//        return responseVo;
//    }

}
